package com.galaxy.order.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.order.domain.vo.OrderVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单退款对象 order_refund
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("order_refund")
public class OrderRefund extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 退款单号
     */
    private String refundNo;

    /**
     * 退款金额
     */
    private BigDecimal refundAmount;

    /**
     * 退款类型(1:整单退款,2:部分退款)
     */
    private Integer refundType;

    /**
     * 退款原因
     */
    private String reason;

    /**
     * 退款状态(0:待处理,1:已同意,2:已拒绝)
     */
    private Integer status;

    /**
     * 处理时间
     */
    private LocalDateTime handleTime;

    /**
     * 处理结果
     */
    private String handleResult;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 订单信息
     */
    @TableField(exist = false)
    private OrderVo order;

    /**
     * 退款类型名称
     */
    @TableField(exist = false)
    private String refundTypeName;

    /**
     * 退款状态名称
     */
    @TableField(exist = false)
    private String statusName;
}
